package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Level;
import com.es.disped.dao.model.LevelExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface LevelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @SelectProvider(type=LevelSqlProvider.class, method="countByExample")
    long countByExample(LevelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @DeleteProvider(type=LevelSqlProvider.class, method="deleteByExample")
    int deleteByExample(LevelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @Delete({
        "delete from level",
        "where level_id = #{levelId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String levelId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @Insert({
        "insert into level (level_id, level_name, ",
        "level_index, level_level, ",
        "level_description, level_valid)",
        "values (#{levelId,jdbcType=CHAR}, #{levelName,jdbcType=VARCHAR}, ",
        "#{levelIndex,jdbcType=INTEGER}, #{levelLevel,jdbcType=INTEGER}, ",
        "#{levelDescription,jdbcType=VARCHAR}, #{levelValid,jdbcType=INTEGER})"
    })
    int insert(Level record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @InsertProvider(type=LevelSqlProvider.class, method="insertSelective")
    int insertSelective(Level record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @SelectProvider(type=LevelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="level_id", property="levelId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="level_name", property="levelName", jdbcType=JdbcType.VARCHAR),
        @Result(column="level_index", property="levelIndex", jdbcType=JdbcType.INTEGER),
        @Result(column="level_level", property="levelLevel", jdbcType=JdbcType.INTEGER),
        @Result(column="level_description", property="levelDescription", jdbcType=JdbcType.VARCHAR),
        @Result(column="level_valid", property="levelValid", jdbcType=JdbcType.INTEGER)
    })
    List<Level> selectByExample(LevelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @Select({
        "select",
        "level_id, level_name, level_index, level_level, level_description, level_valid",
        "from level",
        "where level_id = #{levelId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="level_id", property="levelId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="level_name", property="levelName", jdbcType=JdbcType.VARCHAR),
        @Result(column="level_index", property="levelIndex", jdbcType=JdbcType.INTEGER),
        @Result(column="level_level", property="levelLevel", jdbcType=JdbcType.INTEGER),
        @Result(column="level_description", property="levelDescription", jdbcType=JdbcType.VARCHAR),
        @Result(column="level_valid", property="levelValid", jdbcType=JdbcType.INTEGER)
    })
    Level selectByPrimaryKey(String levelId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @UpdateProvider(type=LevelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Level record, @Param("example") LevelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @UpdateProvider(type=LevelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Level record, @Param("example") LevelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @UpdateProvider(type=LevelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Level record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table level
     *
     * @mbg.generated Wed Jul 03 00:54:54 CST 2019
     */
    @Update({
        "update level",
        "set level_name = #{levelName,jdbcType=VARCHAR},",
          "level_index = #{levelIndex,jdbcType=INTEGER},",
          "level_level = #{levelLevel,jdbcType=INTEGER},",
          "level_description = #{levelDescription,jdbcType=VARCHAR},",
          "level_valid = #{levelValid,jdbcType=INTEGER}",
        "where level_id = #{levelId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Level record);
}